package com.aimei520.po.meun;

import java.util.List;

/**
 * 菜单 实体
 * Title: Menu.java
 * Description:  
 * Copyright: Copyright (c) 2018
 * Company: www.storyboy.xyz 
 * @author JiaXun  
 * @date 2018年8月31日  
 * @version 1.0.0
 */
public class Menu {
	
	private int id;
	private String title;
	private String url;
	private String icon;
	private int pid;
	private String visible;
	private List<Menu> childMenu;

	//是否拥有权限
	private boolean isPossess = false;
	
	public boolean getIsPossess() {
		return isPossess;
	}

	public void setPossess(boolean isPossess) {
		this.isPossess = isPossess;
	}

	public Menu() {
	}

	public Menu(int id, String title, String url, String icon, int pid, String visible) {
		this.id = id;
		this.title = title;
		this.url = url;
		this.icon = icon;
		this.pid = pid;
		this.visible = visible;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getVisible() {
		return visible;
	}

	public void setVisible(String visible) {
		this.visible = visible;
	}

	public List<Menu> getChildMenu() {
		return childMenu;
	}

	public void setChildMenu(List<Menu> childMenu) {
		this.childMenu = childMenu;
	}

	
	@Override
	public String toString() {
		return "Menu [id=" + id + ", title=" + title + ", url=" + url + ", icon=" + icon + ", pid=" + pid + ", visible="
				+ visible + ", childMenu=" + childMenu + ", isPossess=" + isPossess + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (this == obj) {
			return true;
		}
		if (obj instanceof Menu) {
			Menu menu = (Menu) obj;
			if (menu.getId() == this.id && menu.getUrl().equals(this.url)) {
				return true;
			} else {
				return false;
			}
		}
		return false;
	}
	
}
